local skel = fk.CreateSkill {
  name = "emo__qiren",
}

Fk:loadTranslationTable{
  ["emo__qiren"] = "鳍刃",
  [":emo__qiren"] = "你可以将两张不同颜色的牌当无距离和次数限制的【杀】对手牌数不等于体力上限的其他角色使用。",

  ["#emo__qiren"] = "将两张不同颜色的牌当【杀】对手牌数不等于体力上限的角色使用",
}

skel:addEffect("viewas", {
  anim_type = "offensive",
  pattern = "slash",
  prompt = "#emo__qiren",
  mute_card = false,
  handly_pile = true,
  card_filter = function (self, player, to_select, selected)
    if #selected > 1 then return false end
    return #selected == 0 or Fk:getCardById(to_select).color ~= Fk:getCardById(selected[1]).color
  end,
  view_as = function (self, player, cards)
    if #cards ~= 2 then return nil end
    local c = Fk:cloneCard("slash")
    c.skillName = self.name
    c:addSubcards(cards)
    return c
  end,
  before_use = function(self, player, use)
    use.extraUse = true
  end,
  enabled_at_response = function(self, player, response)
    return not response
  end,
})

skel:addEffect("targetmod", {
  bypass_times = function(self, player, skill, scope, card, to)
    return card and to and table.contains(card.skillNames, skel.name) and scope == Player.HistoryPhase
    and to:getHandcardNum() ~= to.maxHp
  end,
  bypass_distances = function(self, player, skill, card, to)
    return card and to and table.contains(card.skillNames, skel.name) and to:getHandcardNum() ~= to.maxHp
  end,
})

skel:addEffect("prohibit", {
  is_prohibited = function(self, from, to, card)
    return card and table.contains(card.skillNames, skel.name) and to and to.maxHp == to:getHandcardNum()
  end,
})

return skel
